﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'ContactoGetList')
	BEGIN
		DROP  Procedure  ContactoGetList
	END
GO

CREATE PROCEDURE ContactoGetList	
	(	
		@empresaId	AS INT,
		@tipo		AS CHAR(1),
		@referencia AS INT
	)	
AS
BEGIN	
	SET NOCOUNT ON
	
	SELECT	ContactoId AS Id, Tipo, Referencia, Nombre, Puesto, Email, Telefono,
			Celular, Notas, Activo, FechaCreacion, FechaModificacion, ModificadoPor      
	FROM Contacto
	WHERE EmpresaId = @empresaId
	  AND Tipo = @tipo
	  AND Referencia = @referencia
	  AND Activo = 1
	 

	SET NOCOUNT OFF
END
GO

 
 
 
 